package com.batchaps.classes;

public class Map {
	/*value : 0-Player  1-ImType1  2-ImType2*/
	private int[][] cell;
	private int nCols;//x
	private int nRows;//y
	
	private int xPlayer;
	private int yPlayer;
	
	public Map(int nC , int nR , int xP , int yP){
		nCols = nC;
		nRows = nR;
		cell = new int[nR][nC];
		for(int i = 0 ; i < nRows ; i++){
			for(int j = 0 ; j < nCols ; j++){
				cell[i][j] = -1;
			}
		}
		xPlayer = xP;
		yPlayer = yP;
	}
	
	public int GetValue(int x , int y){
		return cell[y][x];
	}
	
	public void SetValue(int x , int y , int value){
		cell[y][x] = value;
	}
	
	public void UpdateMyPlayer(int x ,int y){
		cell[yPlayer][xPlayer] = -1;
		cell[y][x] = 0;
	}
	
	/**
	 * @return the cell
	 */
	public int[][] getCell() {
		return cell;
	}
	/**
	 * @param cell the cell to set
	 */
	public void setCell(int[][] cell) {
		this.cell = cell;
	}
	/**
	 * @return the nCols
	 */
	public int getnCols() {
		return nCols;
	}
	/**
	 * @param nCols the nCols to set
	 */
	public void setnCols(int nCols) {
		this.nCols = nCols;
	}
	/**
	 * @return the nRows
	 */
	public int getnRows() {
		return nRows;
	}
	/**
	 * @param nRows the nRows to set
	 */
	public void setnRows(int nRows) {
		this.nRows = nRows;
	}

	/**
	 * @return the xPlayer
	 */
	public int getxPlayer() {
		return xPlayer;
	}

	/**
	 * @param xPlayer the xPlayer to set
	 */
	public void setxPlayer(int xPlayer) {
		this.xPlayer = xPlayer;
	}

	/**
	 * @return the yPlayer
	 */
	public int getyPlayer() {
		return yPlayer;
	}

	/**
	 * @param yPlayer the yPlayer to set
	 */
	public void setyPlayer(int yPlayer) {
		this.yPlayer = yPlayer;
	}
	
}
